Springboot使用put、delete请求报错405怎么解决 |
您所在的位置:网站首页 › vs code如何改成中文 › Springboot使用put、delete请求报错405怎么解决 |
Springboot使用put、delete请求报错 SpringBoot给我们自动配置好了HiddenHttpMethodFilter,但是最近发现好像用不了,我用的是SpringBoot版本是2.2.2,默认配置被改成了false,也就是关闭了自动配置,不知道sprongboot什么鬼,坑!!! There was an unexpected error (type=Method Not Allowed, status=405).Request method 'POST' not supportedorg.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported 要把springboot配置yml文件改成 spring: mvc: hiddenmethod: filter: enabled: true登录后复制Springboot错误提示405状态一、错误提示405状态截图SpringBoot的自动配置中默认是关闭spring.mvc.hiddenmethod.filter 过滤器的,所以当我们提交的数据是PUT、POST、DELETE方式时,我们使用的 _method 并不起作用。 spring.mvc.hiddenmethod.filter 自动配置: 在 Spring Boot 的配置文件 application.properties 中将 hiddenmethod.filter 过滤器设置为启用即可。 spring.mvc.hiddenmethod.filter.enabled=true登录后复制以上就是Springboot使用put、delete请求报错405怎么解决的详细内容,更多请关注php中文网其它相关文章! |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |